<?php
	include(ROOTPATH .'include'. DS .'protect.php');
	include(ROOTPATH .'include'. DS .'initUser.php');

	$title = htmlShow($show['name']) ;
	include "header.php"; 
?>
<script type="text/javascript" src="<?php echo JSLAB_PATH;?>cookies.js"></script>
<?php /*?><script type="text/javascript" src="<?php echo JSLAB_PATH;?>beautyStyle/js/beautyStyle.js"></script>
<link href="<?php echo JSLAB_PATH;?>beautyStyle/images/beautyStyle.css" type="text/css" rel="stylesheet" media="all" /><?php */?>
<script type="text/javascript" src="<?php echo JS_PATH;?>show.js"></script>
<?php /*?><script src="<?php echo JSLAB_PATH;?>Scripts/swfobject_modified.js" type="text/javascript"></script><?php */?>
</head>
<body id="show">
<?php
	if( 'iframe' == $showType){
		echo '<div class="pos100">';
	}else{
		if( $isShowTop )
			require('top.php');
		echo '<div class="pos">';
	};?>
    <div class="contents mediaShow" id="mediaShow">
		<?php
		if( $isShowNav )
			require('nav.php');		
        if( $isShowTitileBar){
        ?> 
            <h2 class="title" id="showID" showID="<?php echo $show['id'] ?>"><?php echo $navigation -> getList();?><?php echo htmlShow($show['name']); ?>
            <span>
            <?php
		if( $isMy || $user -> powder() >= 9 )	{
			if(($isMy && $show['lock'] == '1')){
        		echo '<b>'.lang_have_been_locked .'</b>';
			}
			
			if( $mediaFile -> isFileCanDel($id) )
				echo '<a class="actiondel" href="'.WEB_ROOT_PATH.'?option=userDo&type=action&do=delFile&id='.$idCode.'">'.lang_del.'</a>';
			else
				echo '<a class="disabled">'.lang_del.'</a>';
			
			if( $mediaFile -> isFileCanEdit($id) )
				echo '<a class="actionedit" href="'.urlRewrite('option=creatMedia&id='.$idCode ).'">'. lang_edit .'</a>';
			else
				echo '<a class="disabled">'.lang_edit.'</a>';
			
			echo $mediaFile -> showStatus($id);
		}
        ?>
            </span>
            </h2>
        <?php  }else{ ?>
			<h2 class="title" id="showID"><?php echo htmlShow($show['name']); ?></h2>
		<?php } ?>
        
        <?php require('showFiles.php');  ?>
        <hr />
        
        <?php
			if( $honor = $honor -> getFileList( $id ) ){
		?> 
            <h3><?php echo lang_before_honor;?>:</h3>
            <?php echo $honor; ?>
            <hr /> 
        <?php
			}
		?>
        <?php
			
				if( $taskOngoning = $task -> getFileTaskOngoing($id)){
					echo $taskOngoning ;
				}else{
					if($isMy){
						$tasks = $dbs -> select('SELECT * FROM `'.DB_PRE.'task` WHERE `timeEnd` > "'. date('Y-m-d',time()) .'" ');
						if( count($tasks) > 0 ){ ?>
							<form action="<?php echo WEB_ROOT_PATH;?>?option=taskAction&type=action&do=taskAttend&file_id=<?php echo $idCode;?>" method="post" id="taskAttendForm">
							<label class="highBig"><?php echo lang_submit_to_contest ;?></label>
							<select name="task_id" id="task_id">
							<?php 
							foreach($tasks as $task){
							?><option value="<?php echo $encrypt -> code( $task['id']);?>"><?php echo $task['name'];?></option><?php
							}
							?>
							</select>
							<input type="submit" value="<?php echo lang_submit ;?>" class="submit" />
							</form>
							<hr />
						<?php
						}
					}
				}
		?>
        
		<?php if( $isShowJudgeStar ){?>
        <hr />
        <div class="star yellow judgeStar"><?php echo lang_grade; ?><span>
        <?php
			for($i=1; $i<= MEDIA_STAR ; $i++){
			$class = $i <= (int)$show['star'] ? ' class="a" ' : '';
			echo '<a'.$class.' title="'.$i.'" href="'.WEB_ROOT_PATH.'?option=taskAssessAction&type=action&do=star&star='.$i.'&id='.$file_id.'&query='.$queryCode.'"></a>';
			}
        ?>
        </span></div>  
        <hr /> 
        <hr />
        <?php }?>
         
        </div><!-- .mediaShow -->
        
        <hr />  
              
		<?php
            if($isShowBasicInfo)
                require('showBasicInfo.php');
        ?>
        <?php if( $isShowComments ){?>        
        <h2 class="title"><?php echo lang_comment ;?></h2>
        <div id="comments" class="comments">
            <ul class="box">
                <?php require('comments.php');  ?>            
            </ul>
        </div>
        <?php } ?>
    </div><!-- .contents--> 
</div>

<?php
	if( $isShowFooter)
		require('footer.php');

if( $user -> powder() >= 9 )
	echo '['.$id .']';
?>

</body>
</html>